home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / gr1hw.h.z / gr1hw.h
C/C++ Source or Header  |  1992-04-03  |  15KB  |  428 lines

  1. #ifndef __SYS_GR1HW_H__
  2. #define __SYS_GR1HW_H__
  3.  
  4. /*
  5.  *  sys/gr1hw.h -- GR1 Family Hardware Description
  6.  *
  7.  *  Boards supported:  GR1, GR1.5, VGR2, PGR
  8.  *
  9.  *  $Revision: 1.22 $ 
  10.  *
  11.  *  Copyright 1991, Silicon Graphics, Inc. 
  12.  *  All Rights Reserved.
  13.  *
  14.  *  This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  15.  *  the contents of this file may not be disclosed to third parties, copied or 
  16.  *  duplicated in any form, in whole or in part, without the prior written 
  17.  *  permission of Silicon Graphics, Inc.
  18.  *
  19.  */
  20.  
  21. struct xmap2 {
  22.     volatile unsigned long int noop ;
  23.     volatile unsigned long int blue ;
  24.     volatile unsigned long int green ;
  25.     volatile unsigned long int red ;
  26.     volatile unsigned long int addrinc ;
  27.     volatile unsigned long int other ;
  28.     volatile unsigned long int addrhi ;
  29.     volatile unsigned long int addrlo ;
  30. } ;
  31.  
  32. /* 
  33.  * XPCs are only used on the MGR and AGR.  They've been included because
  34.  * their addresses are reserved in the GR1 family's address space
  35.  */
  36. struct xpc {
  37.     volatile unsigned long int mxReg[4] ;
  38. } ;
  39.  
  40. struct bt457_dac {
  41.     volatile unsigned long int addr ;
  42.     volatile unsigned long int color ;
  43.     volatile unsigned long int control ;
  44.     volatile unsigned long int overlay ;
  45. } ;
  46.  
  47. struct gr1_824dac {
  48.     volatile unsigned long int dacReg[4] ;
  49. } ;
  50.  
  51. struct bt431_cursor {
  52.     volatile unsigned long int addr0 ;
  53.     volatile unsigned long int addr1 ;
  54.     volatile unsigned long int glyph ;
  55.     volatile unsigned long int control ;
  56. } ;
  57.  
  58. struct hq1 {
  59.     volatile unsigned long int clearstall ;
  60.     unsigned long int pad0[15] ;
  61.     volatile unsigned long int setss ;
  62.     unsigned long int pad1[15] ;
  63.     volatile unsigned long int clearss ;
  64.     unsigned long int pad2[15] ;
  65.     volatile unsigned long int executess ;
  66.     unsigned long int pad3[15] ;
  67.     volatile unsigned long int readpc ;
  68.     unsigned long int pad4[15] ;
  69.     volatile unsigned long int clearintr ;
  70.     unsigned long int pad5[15] ;
  71. } ;
  72.  
  73. struct gr1_hw {
  74.     volatile unsigned long int ucstore[256] ;    /* 0x0 */
  75.  
  76.     struct xmap2 xmap[5] ;                /* 0x400 */
  77.     struct xmap2 xmapAll ;                /* 0x4A0 */
  78.  
  79.     volatile unsigned long int displayReg1 ;    /* 0x4C0 */
  80.     unsigned long int pad0[7] ;            /* 0x4C4 */
  81.     volatile unsigned long int displayReg0 ;    /* 0x4E0 */
  82.     unsigned long int pad1[7] ;            /* 0x4E4 */
  83.  
  84.     struct bt457_dac redDac ;            /* 0x500 */
  85.     struct xpc xpc0 ;                /* 0x510 */
  86.     struct bt457_dac greenDac ;            /* 0x520 */
  87.     struct xpc xpc1 ;                /* 0x530 */
  88.     struct bt457_dac blueDac ;            /* 0x540 */
  89.     struct xpc xpc2 ;                /* 0x550 */
  90.     struct bt431_cursor cursor0 ;            /* 0x560 */
  91.     struct xpc xpc3 ;                /* 0x570 */
  92.     struct bt431_cursor cursor1 ;            /* 0x580 */
  93.     struct xpc xpc4 ;                /* 0x590 */
  94.  
  95.     volatile unsigned long int displayReg4 ;    /* 0x5A0 */
  96.     unsigned long int pad2[3] ;            /* 0x5A4 */
  97.  
  98.     struct xpc xpcAll ;                /* 0x5B0 */
  99.  
  100.     volatile unsigned long int displayReg3 ;    /* 0x5C0 */
  101.     unsigned long int pad3[3] ;            /* 0x5C4 */
  102.  
  103.     struct gr1_824dac rgbDac ;            /* 0x5D0 */
  104.  
  105.     volatile unsigned long int displayReg2 ;    /* 0x5E0 */
  106.  
  107.     unsigned long int pad4[23] ;            /* 0x5E4 */
  108.  
  109.     struct hq1 hq ;                    /* 0x640 */
  110.  
  111.     unsigned long int pad5[16] ;            /* 0x7C0 */
  112.  
  113.     volatile unsigned long int fifo[256] ;        /* 0x800 */
  114.  
  115.     volatile unsigned long int HQaddrhi[128] ;    /* 0xC00 */
  116.  
  117.     volatile unsigned long int clrHQaddrMSB ;    /* 0xE00 */
  118.     volatile unsigned long int setHQaddrMSB ;    /* 0xE04 */
  119.  
  120.     unsigned long int pad6[382] ;            /* 0xE08 */
  121.  
  122.     volatile unsigned long int dataram[256] ;    /* 0x1400 */
  123.  
  124.     unsigned long int pad7[512] ;            /* 0x1800 */
  125.  
  126.     volatile unsigned long int finish0 ;        /* 0x2000 */
  127.     volatile unsigned long int finish1 ;        /* 0x2004 */
  128.  
  129.     unsigned long int pad8[(0x207c-0x2008)/4] ;    /* 0x2008 */
  130.  
  131.     /* register use to distinguish Gr1 vs Gr2 */
  132.     volatile unsigned long int GR1vsGR2;        /* 0x207c */
  133.     unsigned long int pad9[(0x8000-0x2080)/4];    /* 0x2080 */
  134.  
  135.     /*
  136.      * The following are registers found only on these variants of the GR1:
  137.      *    - VGR2 (9U GR1, usable with either private bus or VME)
  138.      *    - PGR (6U GR1)
  139.      * They are not mapped into a GL process's address map, since only
  140.      * the kernel manipulates them.
  141.      */
  142.  
  143.     /* board PAL initializes vgrIntrCfg correctly => no need to touch */
  144.     volatile unsigned long int vgrIntrCfg ;        /* 0x8000 */
  145.     unsigned long int pad10[(0x100-4)/4] ;        /* 0x8004 */
  146.  
  147.     /* no need to touch this register when on private bus */
  148.     volatile unsigned long int vgrVmeReset ;    /* 0x8100 */
  149.     unsigned long int pad11[(0x100-4)/4] ;        /* 0x8104 */
  150.  
  151.     /* signals are active low */
  152.     volatile unsigned long int vgrIsr ;        /* 0x8200 */
  153.     unsigned long int pad12[(0x100-4)/4] ;        /* 0x8204 */
  154.  
  155.     /* 0 = disabled, 1 = enabled */
  156.     volatile unsigned long int vgrImask ;        /* 0x8300 */
  157.     unsigned long int pad13[(0x100-4)/4] ;        /* 0x8304 */
  158.  
  159.     /* writing anything clears the vertical retrace interrupt */
  160.     volatile unsigned long int vgrVRIntrClr ;    /* 0x8400 */
  161.     unsigned long int pad14[(0x100-4)/4] ;        /* 0x8404 */
  162.  
  163.     /*
  164.      * NOTE: This reg is defined at 0x85E0 instead of 0x8500 so
  165.      * that it overlaps display reg 2 on GR1.  This allows us
  166.      * to write a probe routine that can tell the difference
  167.      * between a GR1 and VGR.  The reg will respond the same
  168.      * at either address on the VGR.
  169.      * Otherwise, no need to touch this register when on private bus.
  170.      */
  171.     unsigned long int pad15[0xE0/4] ;        /* 0x8500 */
  172.     volatile unsigned long int vgrVmeIntrId ;    /* 0x85E0 */
  173.     unsigned long int pad16[(0x100-0xE4)/4] ;    /* 0x85E4 */
  174.  
  175.     /* no need to touch this register when on private bus */
  176.     volatile unsigned long int vgrVmeDma ;        /* 0x8600 */
  177.  
  178.     /* 
  179.      * each VGR2 and PGR board decodes an address range of 0x10000 
  180.      * => sizeof(struct gr1hw) must be 0x10000 
  181.      */
  182.     unsigned long int pad17[(0x10000-0x8604)/4] ;    /* 0x8604 */
  183. } ;
  184.  
  185.  
  186.  
  187. /* RAMs */
  188.  
  189. /*
  190.  * Microcode RAM sizes in WORDs:
  191.  *    MGR, AGR, PGR:    0x8000
  192.  *    others:        0x4000
  193.  */
  194. #define DRAM_SIZE    0x2000    /* Data RAM size in WORDs */
  195.  
  196. /* HQ */
  197.  
  198. #define HQM_PG_SIZE    256    /* 256 long addressable area w/ HQM */
  199.  
  200. /*
  201.  *  Bt431 Cursor chip
  202.  */
  203.  
  204. #define CURS_GLYPH_SIZE 512    /* Number bytes in glyph */
  205.  
  206. /* Control register offsets */
  207. #define CURS_CMD    0
  208. #define CURS_XLO    1
  209. #define CURS_XHI    2
  210. #define CURS_YLO    3
  211. #define CURS_YHI    4
  212. #define CURS_WINXLO    5
  213. #define CURS_WINXHI    6
  214. #define CURS_WINYLO    7
  215. #define CURS_WINYHI    8
  216. #define CURS_WINWLO    9
  217. #define CURS_WINWHI    10
  218. #define CURS_WINHLO    11
  219. #define CURS_WINHHI    12
  220.  
  221. #define CURS_XHOTOFF    31    /* offsets from origin to hotspot */
  222. #define CURS_YHOTOFF    31    /* glyph 0,0 is lower left */
  223.  
  224.                 /* cursor magic offsets for 1280x1024 */
  225. #define CURS_XOFF_1280 (0+246-57)    /* D+H-P offset for Cx */
  226. #define CURS_YOFF_1280 (39-32)        /* V-32 offset for Cy */
  227.  
  228.                 /* cursor magic offsets for 1024x768 */
  229. #define CURS_XOFF_1024 (0+126-57)    /* D+H-P offset for Cx */
  230. #define CURS_YOFF_1024 (43-32)        /* V-32 offset for Cy */
  231.  
  232.                 /* cursor magic offsets for NTSC */
  233. #define CURS_XOFF_NTSC -6        /* Determined empirically. */
  234. #define CURS_YOFF_NTSC -554        /* Same */
  235.  
  236.                 /* cursor magic offsets for PAL */
  237. #define CURS_XOFF_PAL 24        /* Determined empirically. */
  238. #define CURS_YOFF_PAL -457        /* Same */
  239.  
  240.                 /* cursor magic offsets for 30HZ */
  241.     /* XXX CHECK THESE VALUES */
  242. #define CURS_XOFF_30 39        /* Taken from Aspen values. */
  243. #define CURS_YOFF_30 18        /* Same */
  244.  
  245.                 /* cursor magic offsets for STEREO */
  246.     /* XXX CHECK THESE VALUES */
  247. #define CURS_XOFF_STEREO CURS_XOFF_1280        /* Taken from Aspen values. */
  248. #define CURS_YOFF_STEREO (CURS_YOFF_1280+1)    /* Taken from Aspen values. */
  249.  
  250.  
  251.  
  252. /* GR1 rev. A board defines - needed to determine curs offsets */
  253. #define REVA_EADDRLO    0x69010000    /* Lowest rev. A board ethernet addr */
  254. #define REVA_EADDRHI    0x6901001B    /* Highest rev. A board ethernet addr */
  255.  
  256. #define CURS_XOFFREVA     309           /* x hardware offset Rev. A board */
  257.  
  258. /* Command register bits */
  259. #define CURS_BLOCK    0x40        /* block cursor */
  260. #define CURS_CROSS    0x20        /* Cross hair cursor */
  261. #define    CURS_FMT    0x01        /* if both block & cursor are enabled:*/
  262.                     /* 0 - '^', 1 - '|' bits */
  263. #define CURS_1TO1MUX    0x00        /* use 1:1 multiplexing */
  264. #define CURS_4TO1MUX    0x04        /* use 4:1 multiplexing */
  265. #define CURS_5TO1MUX    0x08        /* use 5:1 multiplexing */
  266. #define CURS_1THICK    0x00        /* Cross hair is 1 bit thick */
  267. #define CURS_3THICK    0x01        /* Cross hair is 3 bits thick */
  268. #define CURS_5THICK    0x02        /* Cross hair is 5 bits thick */
  269. #define CURS_7THICK    0x03        /* Cross hair is 7 bits thick */
  270.  
  271.  
  272. /* XMAPs */
  273.  
  274. /* XMAP2 mode register bit defines */
  275. #define XMAP_DISPLAY    0x7     /* Bits in mode reg to select display mode */
  276. #define XMAP_BUFSEL    0x8    /* Bit in mode reg to select out buf */
  277. #define XMAP_OVER    0xf0    /* Bits in mode reg to enable overlay planes */
  278. #define XMAP_UNDER    0x100    /* Bit in mode reg to enable underlay */
  279. #define XMAP_MULTIMAP    0x200    /* Bits in mode reg to enable multimap mode */
  280. #define XMAP_MAPNUM    0x3C00    /* Bits in mode reg for multimap map number */
  281. #define XMAP_MMAP_SHIFT 10    /* bits to shift up map before or-ing in */
  282.  
  283. /* garbage !! who needs this incorrect define ??? */
  284. #define XMAP_MAPSEL    0x3C    /* Bits in mode reg for multimap map number */
  285.  
  286. /* XMAP2 mode register display mode defines */
  287. #define XMAP_8CI    0x0 /* 8 bitplane, 8-bit color index */
  288. #define XMAP_8DCI    0x1 /* 8 bitplane, 4-bit double buffered color index */
  289. #define XMAP_24DCI    0x2 /* 24 bitplane, 12-bit double buffered color index*/
  290. #define XMAP_24RGB    0x4 /* 24 bitplane, 24-bit RGB */
  291. #define XMAP_24DRGB    0x5 /* 24 bitplane, 12-bit double buffered RGB */
  292.  
  293. #define XMAP_MODEREG_OFF    0
  294. #define XMAP_WIDAUX_OFF        32
  295. #define XMAP_DREG_OFF        33
  296. #define XMAP_NXMAP        5    /* Number XMAP2's */
  297. #define XMAP_NCOLMAPENT        4096    /* Number col map entries */
  298. #define XMAP_NAUXMAPENT        16    /* Number aux col map entries */
  299. #define XMAP_NMULTIMAP        16    /* Number multimaps */
  300. #define XMAP_NMODEREGS        16    /* # of entries in mode reg table */
  301. #define XPC_NMODEREGS        4    /* # of entries in mode reg table */
  302.  
  303. #define XMAP_COLSEL        0x1000    /* bit set in A reg to select col tbl */
  304.  
  305.  
  306. /* DACs */
  307.  
  308. #define DAC_CMDMASK    (0x3 << 2)    /* DAC Mask to get command */
  309. #define DAC_AREG    (0x0 << 2)    /* DAC op: RW addr reg */
  310. #define DAC_COL        (0x1 << 2)    /* DAC op: RW color palette RAM */
  311. #define DAC_CR        (0x2 << 2)    /* DAC op: RW control reg.s */
  312. #define DAC_OVRLAY    (0x3 << 2)    /* DAC op: RW overlay color */
  313.  
  314. #define DAC_READMASK    0x4        /* offset of read mask */
  315. #define DAC_BLINKMASK    0x5        /* offset of blink mask */
  316. #define DAC_CMD        0x6        /* offset of command register */
  317. #define DAC_TEST    0x7        /* offset of test register */
  318. #define DAC_NGAMMAENT    256        /* Number gamma ramp entries */
  319. #define DAC_NOVLMAPENT    4        /* Number overlay map entries */
  320.  
  321. /* DAC command register bit settings: */
  322. #define DAC_5TO1MUX    0x80        /* use 5:1 multiplexing */
  323. #define DAC_RAMENBL    0x40        /* Use RAM if over bits are 0 */
  324. #define DAC_BLINK0    0x00        /* blink rate 0: 1.024(75/25) */
  325. #define DAC_BLINK1    0x10        /* blink rate 1: 0.512(50/50) */
  326. #define DAC_BLINK2    0x20        /* blink rate 2: 1.024(50/50) */
  327. #define DAC_BLINK3    0x30        /* blink rate 3: 2.048(50/50) */
  328. #define DAC_OL1BENBL    0x08        /* OL1 Blink Enable */
  329. #define DAC_OL0BENBL    0x04        /* OL0 Blink Enable */
  330. #define DAC_OL1ENBL    0x02        /* OL1 Enable */
  331. #define DAC_OL0ENBL    0x01        /* OL0 Enable */
  332.  
  333.  
  334. /* Display registers */
  335.  
  336. #define NDREG            5    /* Number of display reg's */
  337.  
  338. /*            REG 0                 */
  339. #define DREG_GRF1EN        0x01 /* Bit to enable GRF1 board,
  340.                     disable for RE2 (LOW ENABLED) (reg 0) */
  341. #define DREG_ZBUF0        0x08 /* Status bit: Z-buffer installed
  342.                     (LOW ENABLED) (reg 0) -- MGR only */
  343. #define DREG_SMALLMON0        0x08 /* Status bit: small monitor installed
  344.                     (LOW ENABLED) (reg 0) -- non MGR */
  345.                      
  346. #define DREG_PGROUTBIT        0x04 /* PGR is characterized by DREG0 CR2 being 
  347.                         routed back to CR4 */
  348. #define DREG_PGRINBIT        0x10
  349.  
  350. /*            REG 1                 */
  351. #define DREG_SYNCGRN        0x01 /* Bit to enable composite SYNC on Green
  352.                     (LOW ENABLED) (reg 1) */
  353. #define DREG_MONITORMSBMASK    0x06 /* MSBs of monitor type (rest in reg4) */
  354.  
  355. #define DREG_TURBO        0x08 /* Status bit: turbo option installed
  356.                     (LOW ENABLED) (reg 1) */
  357. #define DREG_OVRLAY0A        0x10 /* Status bit: DAC overlay bit 0 bank A
  358.                     (reg 1) */
  359.  
  360. /*            REG 2                 */
  361. #define DREG_SCREENON        0x01 /* Bit to turn screen on (reg 2) */
  362. #define DREG_UNCOM2        0x02 /* Uncommitted bit to xilink (reg 2) */
  363. #define DREG_LEDOFF        0x04 /* Bit to turn off LED (reg 2) */
  364. #define DREG_BITPLANES        0x08 /* Status bit: extra bitplanes installed
  365.                     (LOW ENABLED) (reg 2) */
  366. #define DREG_ZBUF        0x10 /* Status bit: Z-buffer installed
  367.                     (LOW ENABLED) (reg 2) -- non MGR */
  368.  
  369. /*            REG 3                 */
  370. #define DREG_GENSTATEN        0x01 /* enable status out of genlock connector*/
  371. #define DREG_LSBBLUE_OUT    DREG_GENSTATEN
  372.                      /* Buffer or latch the blue LSB output 
  373.                       * This feature exists only on VGR and is
  374.                       * in place of DREG_GENSTATEN */
  375.  
  376. #define DREG_LCARESET        0x02 /* Bit to reset LCA
  377.                     (LOW ENABLED) (reg 3) */
  378. #define DREG_MONITORRESET    0x04 /* Bit to reset monitor type (reg 3) */
  379. #define DREG_FIFOEMPTY        0x08 /* Status bit: FIFO empty
  380.                     (LOW ENABLED) (reg 3) */
  381. #define DREG_FIFOFULL        0x10 /* Status bit: FIFO 1/2 full
  382.                     (LOW ENABLED) (reg 3) */
  383.  
  384. /*            REG 4                 */
  385. #define DREG_MONITORMASK    0x03 /* Mask for LSBs of monitor type (reg 4) */
  386. #define DREG_EXTCLKSEL        0x04 /* Bit to select external clock (reg 4) */
  387. #define DREG_MEGOPT        0x08 /* Status bit: 1Meg Video RAMs installed
  388.                     (reg 4) */
  389. #define DREG_GESTALL        0x10 /* Status bit: GE stalled
  390.                     (LOW ENABLED) (reg 4) */
  391. #define DREG_ACLKEN        0x20 /* Bit to enable clock asynchronously
  392.                     (reg 4) */
  393. #define DREG_SCLKEN        0x40 /* Bit to enable clock synchronously
  394.                     (reg 4) */
  395.  
  396. /*            Monitor bits (for reg 1 and reg4)        */
  397. #define DREG_MONITOR60HZ    0x00 /* Monitor type 60Hz 1280x1024  */
  398. #define DREG_MONITOR30HZ    0x01 /* Monitor type 30Hz 1280x1024  */
  399. #define DREG_MONITORNTSC    0x02 /* Monitor type NTSC 645x485 */
  400. #define DREG_MONITORPAL        0x03 /* Monitor type PAL 780x575 */
  401. #define DREG_MONITORSTEREO    0x04 /* Monitor type 120HZ 1280X512X2 */
  402.  
  403. /* these are specific to VGR, but should be place holders for GR1 */
  404. #define DREG_LSBBLUE_LATCH      0x05 /* set mode of blue LSB out to vmux/cg */
  405. #define DREG_LSBBLUE_BUF        0x06 /* set mode of blue LSB out to vmux/cg */
  406. #define DREG_MONITORMED60HZ    0x0f /* Monitor type 60HZ 1024X768 */
  407.  
  408. /*
  409.  * Bits in the vgrIntrCfg register-- 
  410.  */
  411. #define VGR_HDMA_EN    0x1    /* active low host dma enable bit, given
  412.                  * to the board that is allowed on the bus
  413.                  */
  414. /* 
  415.  * Bits in VGR and PGR interrupt status and mask registers vgrIsr and 
  416.  * vgrImask.  The bit assignments are the same for both registers, so
  417.  * there's no need for separate defines.  vgrIsr signals are active low. 
  418.  * In vgrImask, 0 = disabled, 1 = enabled.
  419.  */
  420.                     /* active low */
  421. #define VGR_VR        0x004        /* Vertical retrace interrupt */
  422. #define VGR_GE        0x040        /* GE interrupt */
  423. #define VGR_FIFO    0x080        /* FIFO full interrupt */
  424. #define VGR_VRSTAT    0x200        /* Vertical retrace status (not an 
  425.                      * interrupt) -- only in vgrIsr */
  426.  
  427. #endif /* __SYS_GR1HW_H__ */
  428.